if (GLIB2_FOUND)
	return()
endif()

set(SAVE_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${PROJECT_SOURCE_DIR}/bundle")
find_package(PkgConfig)
if (NOT PKG_CONFIG_FOUND)
	message(FATAL_ERROR "Use 'script/gtk+.sh' to setup glib2 environment.")
endif()

pkg_check_modules(GLIB2 REQUIRED glib-2.0 gobject-2.0 gthread-2.0)

set(CMAKE_PREFIX_PATH ${SAVE_CMAKE_PREFIX_PATH})
set(BUNDLE_GLIB2_FOUND 1 CACHE INTERNAL "bundled glib2 is found")
